﻿namespace EasyToolkit.BindingTemplates.Definitions.Binding
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using EasyToolkit.BindingTemplates.Context;
    using EasyToolkit.BindingTemplates.Definitions;

    public interface IBindingDefinition : IDefinitionPart
    {
        string BindingExpression { get; }
        string Name { get; }
        string Description { get; }

        bool IsACollection { get; }
        //bool IsALinqCollection { get; }
        
        bool IsReadOnly { get; }
        bool CanNotify { get; }
        bool IsOptional { get; }
        bool IsBoundWithData{ get; }
        
        Type BindingType { get; }
        bool BindingTypeIsGeneric { get; }
        Type BindingGenericType { get; }
        Type BindingGenericTypeDefinition { get; }

        object UpdateDataSource(object dataSource, object data);
        object ResolveBinding(object dataSource);
        bool MustNotify(object dataSource, object source, PropertyChangedEventArgs args);
        IEnumerable<INotifyPropertyChanged> GetObjectsToNotify(object dataSource);

        IBindingContextItem ContextItemFactory(IBindingContextElement parent);
    }
}
